package mappedClass;

// Generated 3 juil. 2014 12:40:01 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Taskexpense generated by hbm2java
 */
@Entity
@Table(name = "taskexpense", catalog = "test")
public class TaskExpense implements java.io.Serializable {


	private Integer id;
	private Task task;
	private Integer completionTime;
	private Date currentDate;

	public TaskExpense() {
	}

	public TaskExpense(Task task, Integer completionTime, Date currentDate) {
		this.task = task;
		this.completionTime = completionTime;
		this.currentDate = currentDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "taskId", nullable = false)
	public Task getTask() {
		return this.task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	@Column(name = "completionTime")
	public Integer getCompletionTime() {
		return this.completionTime;
	}

	public void setCompletionTime(Integer completionTime) {
		this.completionTime = completionTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "currentDate", length = 10)
	public Date getCurrentDate() {
		return this.currentDate;
	}

	public void setCurrentDate(Date currentDate) {
		this.currentDate = currentDate;
	}
	
	@Override
	public String toString() {
		return "TaskExpense [id=" + id + ", task=" + task + ", completionTime="
				+ completionTime + ", currentDate=" + currentDate;
	}

}
